function loadJS(url, callback) {
    // 避免重复加载
    let scriptArrys = $("script");
    if (scriptArrys && scriptArrys.length > 0) {
      for (let i = 0; i < scriptArrys.length; i++) {
        let item = scriptArrys[i];
        if (item.src && item.src.indexOf(url) != -1) {
          if (callback) {
            callback();
          }
          return;
        }
      }
    }

    var script = document.createElement("script");
    var fn = callback || function () {};
    script.type = "text/javascript";
    //IE
    if (script.readyState) {
      script.onreadystatechange = function () {
        if (
          script.readyState == "loaded" ||
          script.readyState == "complete"
        ) {
          script.onreadystatechange = null;
          fn();
        }
      };
    } else {
      //其他浏览器
      script.onload = function () {
        fn();
      };
    }
    script.src = url;
    document.getElementsByTagName("head")[0].appendChild(script);
  }
